<!doctype html>
<html lang="en">

	<head>
		<meta charset="UTF-8" />
		<title>赠送好友</title>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<link rel="stylesheet" type="text/css" href="css/mui.min.css" />
		<style>
			.whole {
				width: 100%;
				background: #ffffff !important;
			}
			
			.mui-content p {
				position: relative;
				padding: 30px 15px;
				background: #fff;
				margin: 15px 0 0 0;
				color: #333;
				text-align: center;
			}
			
			.mui-content p:after {
				content: '';
				background: #65d4a3;
				height: 1px;
				width: 100%;
				position: absolute;
				left: 0;
				bottom: 0;
			}
			
			.mui-input-row .mui-input-clear~.mui-icon-clear,
			.mui-input-row .mui-input-password~.mui-icon-eye {
				padding-top: 15px;
			}
			
			.mui-input-row .mui-numbox{
				float: none;
			}
			
			#sub {
				margin: 30px 0;
				width: 100%;
			}
			form .mui-input-row:nth-child(2):after{
				background: none;
			}
		</style>
	</head>

	<body>

		<header class="mui-bar mui-bar-nav">
			<a href="javascript:history.go(-1)" class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
			<h1 class="mui-title">赠送朋友</h1>
		</header>
		<div class="mui-content id">
			<p>输入正确后赠送</p>
			<div class="whole">
				<form class="mui-input-group">
					<div class="mui-input-row">
						<label>好友账号:</label>
						<input type="text" class="mui-input-clear" name="phone" placeholder="请输入账号或手机号">
					</div>
					<div class="mui-input-row">
						<label class="name">钛数量</label>
						<div class="mui-numbox" data-numbox-step='1' data-numbox-min='100' data-numbox-max='9999'>
							<button class="mui-btn mui-btn-numbox-minus" type="button">-</button>
							<input class="mui-input-numbox" type="number" />
							<button class="mui-btn mui-btn-numbox-plus" type="button">+</button>
						</div>
					</div>
					<div class="mui-input-row">
						<label>交易密码:</label>
						<input type="password" class="mui-input-password" placeholder="请输入交易密码">
					</div>
					<div class="sub">
						<button type="button" id="sub" class="mui-btn mui-btn-blue">赠送</button>
					</div>
				</form>
			</div>
		</div>

		<script src="js/jquery-3.3.1.min.js" type="text/javascript" charset="utf-8"></script>
		<script src="js/mui.min.js" type="text/javascript" charset="utf-8"></script>
		<script type="text/javascript">
			mui.init()
			$('#sub').click(()=>{
				let [check,phone,pwd] = [true,$('input[name="phone"]').val(),$('input[type="password"]').val()]
				if(phone==''){
					mui.toast('账号或手机号不能为空')
					check = false
					return false
				}
				var pay_patrn = /^[0-9]{6}$/
				if(!pay_patrn.test(pwd) && check){
				    mui.toast('支付密码只能输入6位数');
				    check = false;
				    return false;
				}
				if(check){					
					$('form').submit()
				}
			})
		</script>
	</body>

</html>